package com.smart.controller;

import com.smart.pojo.ResultBean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

@RestController
public class TestController {

    @GetMapping("/testGet")
    public List<String> testGet(String name){
        return Arrays.asList(name,"zhangsan","lisi","wangwu");
    }

    @GetMapping("testConnect")
    public ResultBean testConnect(){
        return ResultBean.success();
    }

    @PostMapping("/testPost")
    public List<String> testPost(@RequestBody Map<String,Object> map){
        map.forEach((k,v) -> System.out.println(k + " -> " + v));

        return Arrays.asList("nihao ", "sb");
    }
}
